package model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@SuppressWarnings("serial")
@Embeddable
public class ChiTietDichGia_SachID implements Serializable {
	private int idSach;
	private int idDichGia;

	public ChiTietDichGia_SachID(int idSach, int idDichGia) {
		super();
		this.idSach = idSach;
		this.idDichGia = idDichGia;
	}
	public ChiTietDichGia_SachID() {
	}

	@Column(name = "ID_Sach", nullable = false)
	public int getIdSach() {
		return idSach;
	}

	public void setIdSach(int idSach) {
		this.idSach = idSach;
	}

	@Column(name = "ID_DichGia", nullable = false)
	public int getIdDichGia() {
		return idDichGia;
	}

	public void setIdDichGia(int idDichGia) {
		this.idDichGia = idDichGia;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + idSach;
		result = prime * result + idDichGia;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ChiTietDichGia_SachID other = (ChiTietDichGia_SachID) obj;
		if (idSach != other.idSach)
			return false;
		if (idDichGia != other.idDichGia)
			return false;
		return true;
	}

}
